import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
   {
    path:"/",
    component:()=>import("@/components/BKLayout.vue"),
    children:[
      {
        path:"",
        component:()=>import("@/views/home/HomePage.vue")
      },
      {
       path:"/news",
       component:()=>import("@/views/News/NewsPage.vue")
      },
      {
        path:'/archives',
        component:()=> import("@/views/archives/archives.vue")
      },
      {
        path: "/navigation",
        component: ()=> import("@/views/Navigation/Navigation.vue")
      }
    ]
   },
   {
    path: "/backend",
    component:()=>import("@/views/member/member.vue"),
    children:[
      {
        path:"",
        component:()=>import("@/views/member/user/user.vue")
      },
      {
        path:"add_article",
        component:()=>import("@/views/member/add_article/add_article.vue")
      },{
        path:'edit_article/:id',
        component:()=>import("@/views/member/edit_article/edit_article.vue")
      },
      {
        path:'userActions',
        component:()=>import("@/views/member/userActions/userActions.vue")
      },
      {
        path:'covers',
        component:()=>import("@/views/member/covers/covers.vue")
      },
      {
        path: 'MessageBoard',
        component:()=>import("@/views/member/MessageBoard/MessageBoard.vue")
      }
    ]
   },
   {
    path: "/search/:key*",
    component:()=>import("@/views/Search/SearchPage.vue")
  },
   {
    path:"/article/:id",
    component:()=>import("@/views/Article/ArticlePage.vue"),
   },
   {
    path:"/login",
    component:()=>import("@/views/login/IoginPage.vue"),
   },
   {
    path:"/sign",
    component:()=>import("@/views/Sign/SignPage.vue"),
   }
  ]
})

export default router
